package 抽象类.抽象类特性.抽象类必须被继承;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 姚东名
 * Date: 2024-06-18
 * Time: 16:26
 */
//矩形
public class Rect extends Shape {
    private double length;
    private double width;

    public Rect(double length, double width) {
        this.length = length;
        this.width = width;
    }
    @Override
    public void draw() {
        System.out.println("矩形：length = " + this.length + " width = " + this.width);
    }

    @Override
    void calcArea() {
        area = length * width;
        //super.area = this.length * this.width;
    }
}
